package com.rizzo.analytics.services.web.delegator;

import com.rizzo.analytics.domain.CountResult;
import com.rizzo.analytics.domain.application.Applications;
import com.rizzo.analytics.domain.errors.Errors;
import com.rizzo.analytics.domain.info.Info;
import com.rizzo.analytics.domain.notification.Notifications;
import com.rizzo.analytics.domain.performance.CallInfo;
import com.rizzo.analytics.domain.performance.Performance;
import com.rizzo.analytics.domain.quota.Quotas;
import com.rizzo.analytics.domain.trend.Trend;
import com.rizzo.analytics.domain.trend.TrendType;
import com.rizzo.analytics.services.web.controller.v1.error.ErrorsNotFoundException;
import com.rizzo.analytics.services.web.controller.v1.error.QuotasNotFoundException;
import com.rizzo.infrastructure.domain.KeyType;

public interface AnalyticsDelegator {

    Applications getApplications(String user);

    Info getInfo(String user, String application, KeyType keyType, String category, String instanceName, String instanceIndex);

    Performance getPerformance(String user, String application, String instanceName,
                               String instanceIndex, String category, long limit, long offset, CallInfo.CallSort callSort);

    CountResult savePerformance(String user, String application, Performance performance);

    Trend getTrend(String user, String application, String instanceName, String instanceIndex,
                   String category, long limit, long offset, TrendType trendType);

    Errors getErrors(String user, String application, String code, long limit, long offset) throws ErrorsNotFoundException;

    void saveErrors(String user, String application, Errors errors);

    Quotas getQuotas(String user, String application, String category) throws QuotasNotFoundException;

    void saveQuotas(String user, String application, Quotas quotas);

    Notifications getNotifications(String user, String application, String category, long notificationId);

}
